/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package comits.web.client.servlets.demo;

import java.sql.Timestamp;

import java.text.DateFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 * 
 * @author assia
 */
public class test {

	public static void main(String[] args ) throws ParseException{
        /*   Date d = new Date();
        d.mondayOfWeek(new Date("03/05/2012"));
        d.saturdayOfWeek(new Date("03/07/2012"));
        d.numberOfWeek(new Date("03/07/2012"));
        d.nextWeek(new Date());
        d.nextWeek(new Date("03/16/2012"));
        d.lastWeek(new Date());
        System.out.println("hello");
        d.lastWeek(new Date("02/12/2012"));
         
         * 
         */
        
        
        java.util.Date d1= new Date();
        DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println("this week is"+d1);
        java.util.Date d=(java.util.Date) DateUtil.lastWeek(d1);
        System.out.println("laste wekk is"+d);
        System.out.println("date convertiiiiiiiiiiii " +DateUtil.stringToDate("2012-02-27"));
    //    System.out.println("date convertiiiiiiiiiiii " +df1.format(DateUtil.stringToDate("2012-02-27")));
                    
        System.out.println("laste wekk is"+DateUtil.lastWeek(d));
        
        /////////////////
        
        
        
        String inputDate = "2012-03-26";
        java.util.Date d4=DateUtil.stringToDate1(inputDate);
        System.out.println("1ere methode:"+d4);
//affiche: 1ere methode:Sat May 14 15:53:42 GMT 2005
        System.out.println("1ere methode:"+DateUtil.dateToString1(d4));
//affiche: 1ere methode:05-14-2005 15:53:42
 
        Timestamp t= DateUtil.toDBDateFormat(inputDate);
        System.out.println("1ere methodeek:"+t);
//affiche 2eme methode: 2005-05-14 15:53:42.0
        System.out.println("2eme methodekee: "+DateUtil.dateToString1(t));
//affiche: 2eme methode:05-14-2005 15:53:42
        java.util.Date d5=DateUtil.parseDate("2012-03-26","yyyy-MM-dd");
        System.out.println("2eme mess: "+d5);
        ////////////////////////////
        
        Date aujourdhui = new Date();
        DateFormat shortDateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);
        DateFormat shortDateFormatEN = DateFormat.getDateTimeInstance(
        DateFormat.SHORT,
        DateFormat.SHORT, new Locale("EN","en"));
        DateFormat mediumDateFormat = DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM,
        DateFormat.MEDIUM);
        DateFormat mediumDateFormatEN = DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM,
        DateFormat.MEDIUM, new Locale("EN","en"));
        DateFormat longDateFormat = DateFormat.getDateTimeInstance(
        DateFormat.LONG,
        DateFormat.LONG);
        DateFormat longDateFormatEN = DateFormat.getDateTimeInstance(
        DateFormat.LONG,
        DateFormat.LONG, new Locale("EN","en"));
        DateFormat fullDateFormat = DateFormat.getDateTimeInstance(
        DateFormat.FULL,
        DateFormat.FULL);
        DateFormat fullDateFormatEN = DateFormat.getDateTimeInstance(
        DateFormat.FULL,DateFormat.FULL, new Locale("EN","en"));
        System.out.println(shortDateFormat.format(aujourdhui));
        System.out.println(mediumDateFormat.format(aujourdhui));
        System.out.println(longDateFormat.format(aujourdhui));
        System.out.println(fullDateFormat.format(aujourdhui));
        System.out.println("");
        System.out.println(shortDateFormatEN.format(aujourdhui));
        System.out.println(mediumDateFormatEN.format(aujourdhui));
        System.out.println(longDateFormatEN.format(aujourdhui));
        System.out.println(fullDateFormatEN.format(aujourdhui));
       
        
        SimpleDateFormat formater = null;
        Date a = new Date();
        formater = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println("sss"+formater.format(a));
        
   //     System.out.println("ma dae est le "+formater.format(a));
   
       
     /*  java.util.Date d=(java.util.Date) DateUtil.mardi(d1);
        System.out.println("mardiiiii"+d);
        
          java.util.Date d0=(java.util.Date) DateUtil.mercredi(d1);
        System.out.println("mercredi"+d0);
        
          java.util.Date d2=(java.util.Date) DateUtil.jeudi(d1);
        System.out.println("jeudi"+d2);
        
          java.util.Date d3=(java.util.Date) DateUtil.vendredi(d1);
        System.out.println("vendredi"+d3);
        
          java.util.Date d4=(java.util.Date) DateUtil.samedi(d1);
        System.out.println("samedi"+d4);
  
  */
          
     }
}
